﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WpfApp7.Command;

namespace WpfApp7.ViewModels
{
    public class WpfEventToCommandViewModel:ObservableObject
    {
        private string _text;

        public string Text
        {
            get { return _text; }
            set { _text = value; OnPropertyChanged(); }
        }

        public PdyCommand<string> TextPreviewMouseDown { get; set; }

        public WpfEventToCommandViewModel()
        {
            TextPreviewMouseDown = new PdyCommand<string>(s=> 
            {
                Text += $"您点击了：{DateTime.Now:F}+({s})\r\n";
            });
        }
    }
}
